<template>
  <div id="app">
<!--    <nav>-->
<!--      <router-link to="/">Home</router-link> |-->
<!--      <router-link to="/about"></router-link>-->
<!--    </nav>-->
    <router-view/>

    <dialog-global v-if="logoutDialogShow" :cancleBtnVisible="false" :closeImgShow="false" :dialogFooterShow="true"
                   :confirmBtnText="'确定'" @dialogConfirmFun="dialogConfirmFun">
      <template>
        <div class="dialogChiefText">您的登录已经失效</div>
        <div class="dialogSecondText">请重新登录</div>
      </template>
    </dialog-global>
    <!--退出登录弹窗 start-->
    <dialog-global v-if="confirmLogoutVisible" :dialogFooterShow="true" :confirmBtnText="'确定'"
                   @dialogConfirmFun="confirmQuit" @dialogCancelFun="cancelQuit">
      <template>
        <div class="dialogChiefText">您确定要退出登录吗？</div>
      </template>
    </dialog-global>
  </div>
</template>

<script>
import DialogGlobal from './components/dialog/DialogGlobal.vue'
export default {
  components: {
    DialogGlobal
  },
  data() {
    return {
      confirmLogoutVisible: false,
      logoutDialogShow: false,
    }
  },
  methods: {
    cancelQuit() {
      this.confirmLogoutVisible = false;
    },
    confirmQuit() {
      this.$bus.emit('confirmQuitAccount');
    },
    dialogConfirmFun () {
      this.logoutDialogShow = false;
      sessionStorage.clear()
      localStorage.clear()
      this.$router.replace({
        path: '/studentLogin'
      });
    },
    openLogoutDialogFn() {
      this.logoutDialogShow = true;
    }
  }
}
</script>

<style lang="less">
@import 'assets/default.css';
@import 'assets/css/common.less';
@import 'assets/css/re-customize-el-style.css';
#app {

  //font-family: Avenir, Helvetica, Arial, sans-serif;
  //-webkit-font-smoothing: antialiased;
  //-moz-osx-font-smoothing: grayscale;
  text-align: center;
  height: 100%;
  //color: #2c3e50;
}

nav {
  padding: 30px;
}

nav a {
  font-weight: bold;
  color: #2c3e50;
}

nav a.router-link-exact-active {
  color: #42b983;
}
</style>
